<template>
	<uv-popup ref="submitPopup" bgColor="none" z-index="2147483646" :closeOnClickOverlay="false"
		@maskClick="onWriteOff">
		<reminder title='用户调研' value="趣碰头诚邀您参与用户体验调研~您的建议对我们非常珍贵，我们将根据您的建议来完善产品"
			image="https://pengtou-1322587508.cos.ap-shanghai.myqcloud.com/static/images/order-header-3.png"
			@closePop="closePop" close>
			<view class="signPop">
				<button class="btn-primary btn-default" @tap.stop.prevent="onWriteOff">好的</button>
			</view>
		</reminder>
	</uv-popup>
</template>

<script>
	import throttle from '@/uni_modules/uv-ui-tools/libs/function/throttle.js';
	const app = getApp();
	export default {
		options: {
			styleIsolation: 'shared'
		},
		components: {},
		created() {
			app.watch(this.getcartcount, 'questionnaire') //count是globalData中定义的属性
		},

		onLoad() {

		},
		data() {
			return {};
		},
		methods: {
			goLogin() {
				app.doLogin()
			},
			getcartcount(val) {
				console.log('xxxx');
				let questionnaire = uni.getStorageSync('questionnaire');
				let settleState = app.globalData.UserInfo ? app.globalData.UserInfo.settleState : 0
				if (questionnaire || settleState == 1) {
					return
				}
				this.$nextTick(() => {
					this.$refs.submitPopup.open();
				})
				console.log('输出变化的值', val)
			},
			closePop() {
				this.$refs.submitPopup.close();
			},
			onWriteOff() {
				uni.setStorageSync('questionnaire', true)
				this.$refs.submitPopup.close();
				wx.openEmbeddedMiniProgram({
					appId: 'wxd947200f82267e58',
					path: 'pages/wjxqList/wjxqList?activityId=rRkSKrb'
				})
			}
		},
	};
</script>
<style lang="scss" scoped>
	/deep/.reminder {
		padding-top: 194rpx !important;

		.reminder-image {
			width: 270rpx !important;
		}

		.value {
			margin-bottom: 44rpx !important;
		}
	}

	.signPop {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;

		.btn-primary {
			text-align: center;
			font-size: 26rpx;
			flex-shrink: 0;
			width: 100%;
			height: 80rpx;
			line-height: 80rpx;
		}
	}
</style>